Running from the Command Line

You can run spreadsheet reports from the command line, so you can include report generation in batch scripts and create reports without needing to bring up the aPriori user interface. This can is useful for automated status reports, or automatically feeding aPriori data into another application or database.

Reports run from the command line do not need to be installed in aPriori prior to use. You specify the pathname to the .xml input and .xls output files. Note that you should specify any .xls template file with the templatePath attribute to the reports tag at the top of the .xml file, for example,

<reports traverseAssemblies="true" templatePath="C:\aPriori_templates\report.template.xls">

Otherwise the output .xls file is unformatted; any existing content overwritten.

runAprioriReport.cmd

To generate spreadsheet reports from the command line, you run the runAprioriReport.cmd command, which is in

apriori_install\version\install\bin

This command takes seven arguments which must be provided in the exact order shown as follows. Only the seventh (final) argument is optional.

Syntax

runAprioriReport.cmd co_type co_name xml_report_file xls_output_file
[ scenario_name ]username "password"

Arguments

  • co_type
    Cost object typeeither part, assembly, rollup, or dynamicRollup.

  • co_name
    Cost object name:

  • xml_report_file
    Full pathname to the XML spreadsheet report definition file.

  • xls_output_file
    Full path name to the Excel file to be populated.

  • scenario_name [Optional]
    If scenario_name is omitted, "initial" is assumed.

  • username
    aPriori log-in account name to use for this report session.

  • password
    Associated aPriori password.

Important notes

  • If the optional scenario_name argument is used; it must precede any username and password credentials. For any existing scripts from releases prior to 2018 R1, you must ensure that these arguments follow the new ordering when upgrading.

  • If username and password are not specified as arguments on the command line, the report utility looks for them in the properties file. If they are not found, and if your aPriori administrator has implemented Single Sign On (SSO), the report utility attempts to use the currently logged-in user’s Windows credentials.

  • When an aPriori account password is specified as an argument on the command line, as a best practice, wrap the password in double quotes.

Examples

To run a custom report named "XYZ" that resides in folder named C:\Files, from the command line, and generate an Excel file named results in the same folder, for a part named "r5":

runAprioriReport.cmd part R5 C:\Files\XYZ.watchpoints.xml C:\Files\results.xls initial user1 user1passwd

To run the system-defined Cost Driver report from the command line and generate an Excel spreadsheet in a folder named files, for a part named R6:

runAprioriReport.cmd part R6 “apriori_install\ext\cost-watchpoint-report\watchpoints\Cost Driver.watchpoints.xml” c:\files\results.xls initial user1 user1passwd